package com.zeratul.common.core.result.codes;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 响应码
 */
@Getter
@AllArgsConstructor
public class ResultCodes {

    /**
     * 响应码
     */
    private Integer code;

    /**
     * 响应信息
     */
    private String message;

    /**
     * 成功
     */
    public static final ResultCodes SUCCESS = new ResultCodes(200, "成功");

    /**
     * 服务器异常
     */
    public static final ResultCodes FAIL = new ResultCodes(500, "服务器异常");

    /**
     * 参数异常
     */
    public static final ResultCodes PARAM_ERROR = new ResultCodes(400, "参数异常");

    /**
     * 校验对象不能为空
     */
    public static final ResultCodes VALIDATE_OBJ_NOT_NULL = new ResultCodes(400, "校验对象不能为空");

    /**
     * 认证失败
     */
    public static final ResultCodes AUTH_ERROR = new ResultCodes(401, "认证失败");

    /**
     * 权限异常
     */
    public static final ResultCodes AUTHORIZED_ERROR = new ResultCodes(403, "权限不足");

    /**
     * 资源不存在
     */
    public static final ResultCodes NOT_FOUND = new ResultCodes(404, "资源不存在");
}
